#pragma once
#include "Player.h"
#include "Tile.h"

class GameTile
{
private:
	/*--- Non-Class Variables ---*/
//	Player * m_playerList;
	Tile m_tile;
	Position m_pos;
	/*--- Member Variables ---*/
	bool m_hasTile;
	int m_originalTileOwner;
public:
	GameTile():m_hasTile(false) {
	}
	~GameTile();
	/*--- Accessors ---*/
	bool hasTile() { return m_hasTile; }
	Tile getTile() { return m_tile; }
	int getOwner(){return m_originalTileOwner;}
	Tile popTile() {
		m_hasTile = false;
		return m_tile;
	}
	void placeTile(Tile a_tile, Position pos, int a_owner) {
		m_tile = a_tile;
		m_pos = pos;
		m_originalTileOwner = m_originalTileOwner;
		m_hasTile = true;
	}
	Position getPosition(){ return m_pos;}
	void reset(Position pos){
		m_pos = pos;
	}
	void setPos(Position pos) { m_pos = pos; }
	
	// Draw functions
	SDL_Surface* drawPlayers(SDL_Surface* a_dest, SDL_Surface* a_source, Position a_idArray[], Player * a_players,bool drakonExists);
	SDL_Surface* drawTile(SDL_Surface * a_buffer, SDL_Surface * a_sourceBG, SDL_Surface * a_sourceTile, Position a_idArray[]);
	SDL_Surface* getGameTileSurface(SDL_Surface * a_buffer, SDL_Surface * a_sourceBG, SDL_Surface * a_sourceTile, Position a_idArray[], Player * a_players,bool a_drakonExists);
};